//
//  BKMain_GoodsViewCell.m
//  bestkeep
//
//  Created by utouu666 on 17/2/14.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKMain_GoodsViewCell.h"
#import "BKMainCommon.h"



@implementation BKMain_GoodsViewCell


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initViews];
        
    }
    return self;
}

-(void)initViews{
    
    _goodsView = [[UIView alloc] initWithFrame:self.bounds];
//    _goodsView.backgroundColor = [UIColor redColor];
    [self addSubview:_goodsView];
    
    _goodsImageView = [UIImageView new];
    _goodsImageView.userInteractionEnabled = YES;
    [_goodsView addSubview:_goodsImageView];
    
    [_goodsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(0);
        make.left.equalTo(self.mas_left).offset(7);
        make.right.equalTo(self.mas_right).offset(-7);
        make.width.equalTo(_goodsImageView.mas_height);
    }];
    
    _goodsDetail = [UILabel new] ;
    _goodsDetail.textColor = RGBACOLOR(64, 64, 64, 1);
    _goodsDetail.font = [Common systemFontOfSize:13];
    _goodsDetail.textAlignment = NSTextAlignmentCenter;
    [_goodsView addSubview:_goodsDetail];
    
    [_goodsDetail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_goodsImageView.mas_bottom).offset(12);
        make.left.equalTo(self.mas_left).offset(0);
        make.right.equalTo(self.mas_right).offset(0);
    }];
    
    _goodsPrice = [UILabel new];
    _goodsPrice.textColor = RGBACOLOR(255, 16, 16, 1);
    _goodsPrice.font = [Common systemFontOfSize:14];
    _goodsPrice.textAlignment = NSTextAlignmentCenter;
    [_goodsView addSubview:_goodsPrice];
    [_goodsPrice mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.equalTo(self.mas_bottom).offset(-15);
        make.top.equalTo(self.goodsDetail.mas_bottom).offset(10);
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
    }];
    
    
}

@end
